home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / OpenDoc / ProcessMap / CPProcessMap.Doc.cpp < prev    next >
Encoding:
Text File  |  1995-04-14  |  43.8 KB  |  1,148 lines  |  [TEXT/MPCC]

  1. //----------------------------------------------------------------------------------------
  2. // CPProcessMap.Doc.cp - Documentation for ProcessMap methods.
  3. //----------------------------------------------------------------------------------------
  4.  
  5. // PART
  6. void Explain_Constructor();
  7. void Explain_Destructor();
  8. void Explain_InitPart();
  9. void Explain_InitPartFromStorage();
  10. void Explain_Externalize();
  11. void Explain_Open();
  12. void Explain_Release();
  13. void Explain_ReleaseAll();
  14. void Explain_IncrementRefCount();
  15. void Explain_CloneInto();
  16.  
  17. // EXTENSIONS
  18. void Explain_HasExtension();
  19. void Explain_GetExtension();
  20. void Explain_ReleaseExtension();
  21.  
  22. // DRAGDROP
  23. void Explain_DragLeave();
  24. void Explain_Drop();
  25. void Explain_DragWithin();
  26. void Explain_DragEnter();
  27. void Explain_DropCompleted();
  28. void Explain_FulfillPromise();
  29.  
  30. // EMBED
  31. void Explain_ContainingPartPropertiesChanged();
  32. void Explain_GetContainingPartProperties();
  33. void Explain_RevealFrame();
  34. void Explain_EmbeddedFrameSpec();
  35. void Explain_CreateEmbeddedFramesIterator();
  36. void Explain_EmbeddedFrameChanged();
  37.  
  38. // EVENTS
  39. void Explain_HandleEvent();
  40. void Explain_AdjustMenus();
  41.  
  42. // FOCUS
  43. void Explain_BeginRelinquishFocus();
  44. void Explain_CommitRelinquishFocus();
  45. void Explain_AbortRelinquishFocus();
  46. void Explain_FocusAcquired();
  47. void Explain_FocusLost();
  48.  
  49. // FRAMES
  50. void Explain_DisplayFrameAdded();
  51. void Explain_DisplayFrameConnected();
  52. void Explain_DisplayFrameRemoved();
  53. void Explain_DisplayFrameClosed();
  54. void Explain_FrameShapeChanged();
  55. void Explain_AttachSourceFrame();
  56. void Explain_ViewTypeChanged();
  57. void Explain_PresentationChanged();
  58. void Explain_SequenceChanged();
  59. void Explain_WritePartInfo();
  60. void Explain_ReadPartInfo();
  61. void Explain_RequestEmbeddedFrame();
  62. void Explain_RemoveEmbeddedFrame();
  63. void Explain_RequestFrameShape();
  64. void Explain_UsedShapeChanged();
  65. void Explain_AdjustBorderShape();
  66.  
  67. // FACETS
  68. void Explain_FacetAdded();
  69. void Explain_FacetRemoved();
  70. void Explain_CanvasChanged();
  71. void Explain_GeometryChanged();
  72.  
  73. // IMAGING
  74. void Explain_Draw();
  75. void Explain_CanvasUpdated();
  76. void Explain_HighlightChanged();
  77. void Explain_GetPrintResolution();
  78.  
  79. // LINKING
  80. void Explain_CreateLink();
  81. void Explain_LinkUpdated();
  82. void Explain_RevealLink();
  83. void Explain_LinkStatusChanged();
  84.  
  85. // UNDO
  86. void Explain_UndoAction();
  87. void Explain_RedoAction();
  88. void Explain_DisposeActionState();
  89. void Explain_WriteActionState();
  90. void Explain_ReadActionState();
  91.  
  92. // BINDING
  93. void Explain_ExternalizeKinds();
  94. void Explain_ChangeKind();
  95.  
  96. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  97. // PART
  98. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  99.  
  100. void Explain_Constructor() {}
  101.  
  102. //----------------------------------------------------------------------------------------
  103.  
  104. void Explain_Destructor() {}
  105.  
  106. //----------------------------------------------------------------------------------------
  107.  
  108. void Explain_InitPart() {}
  109.  
  110. //----------------------------------------------------------------------------------------
  111.  
  112. void Explain_InitPartFromStorage() {}
  113.  
  114. //----------------------------------------------------------------------------------------
  115.  
  116. void Explain_Externalize() {}
  117.  
  118. //----------------------------------------------------------------------------------------
  119.  
  120. void Explain_Open() {}
  121.  
  122. // Creates and opens a presentation of the part in a frame
  123. // in a new window.
  124. //
  125. // This method adds this part as the root part of the window.
  126. // It bases the presentation in the new frame on the presentation
  127. // in the old frame, or on a default presentation if there
  128. // is no old frame.
  129.  
  130. //----------------------------------------------------------------------------------------
  131.  
  132. void Explain_Release() {}
  133.  
  134. // If you are using RegisterIdle on the part, not on frames, then
  135. // the RefCount is bumped up by one by OpenDoc.  OpenDoc keeps a
  136. // reference to all parts that register idle time.  ALL OF THESE MUST
  137. // BE RESOLVED BEFORE THE DESTRUCTOR IS CALLED.  This is
  138. // the place to do that.
  139.  
  140. // The logic below, assuming that CPProcessMap has registered for idle
  141. // time, is that if the RefCount is 1, then we are here to unregister
  142. // the idle.  When the part is being removed, OpenDoc must decrement
  143. // the RefCount and call Release until the part gets messaged with
  144. // a RefCount of 0.  Once you return from here with a RefCount of 0,
  145. // OpenDoc will call the destructor.
  146.  
  147. // This means that if you have registered for idle time, Release will
  148. // be called TWICE when closing down your part.  The first time the
  149. // RefCount is 1.  This is when you should unregister the idle time.
  150. // When you are called with a RefCount of 0, that when it gets really
  151. // serious.  This is when you detach from the draft.
  152.  
  153. //----------------------------------------------------------------------------------------
  154.  
  155. void Explain_ReleaseAll() {}
  156.  
  157. //----------------------------------------------------------------------------------------
  158.  
  159. void Explain_IncrementRefCount() {}
  160.  
  161. //----------------------------------------------------------------------------------------
  162.  
  163. void Explain_CloneInto() {}
  164.  
  165. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  166. // EXTENSIONS
  167. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  168.  
  169. void Explain_HasExtension() {}
  170.  
  171. //----------------------------------------------------------------------------------------
  172.  
  173. void Explain_GetExtension() {}
  174.  
  175. //----------------------------------------------------------------------------------------
  176.  
  177. void Explain_ReleaseExtension() {}
  178.  
  179. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  180. // IMAGING
  181. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  182.  
  183. void Explain_Draw() {}
  184.  
  185. // Draws the part in the facet, updating the portion of the
  186. // facet in the invalidShape.
  187. //
  188. // Called by the facet object.
  189. //
  190. // The part should draw itself on the facet's canvas. The part
  191. // must examine its canvas' isDynamic flag to determine if it
  192. // will be drawing on the screen or to a printer, and then draw
  193. // itself appropriately.
  194. //
  195. // Draw the part in the given facet. Only the portion in the
  196. // invalidShape needs to be drawn.
  197. //
  198. // There are several steps a part needs to take to perform the
  199. // imaging.
  200. // 1) The part should look at the given facet and its frame.
  201. //    Both the frame and the facet may have some partInfo that
  202. //    the part has placed there, which the part can use to
  203. //    decide how it will display itself.  The frame also has
  204. //    viewType and presentation fields, which indicate what kind
  205. //    of view of the part should display.
  206. // 2) The part should examine its canvas to see how it should
  207. //    be imaged. The canvas can be obtained from the facet via
  208. //    ODFacet::GetCanvas(). If the canvas’ isDynamic flag is
  209. //    kODTrue, the part is imaging onto a dynamic device like
  210. //    a CRT; otherwise, it is imaging to a static device like
  211. //    a printer. The part will probably display its content
  212. //    differently for static and dynamic views. For instance,
  213. //    it should not display scroll bars on a static canvas.
  214. // 3) The part must make sure the platform graphics system is
  215. //    prepared to draw into the correct context for the facet.
  216. //    On the Macintosh using QuickDraw, it is necessary to call
  217. //    SetPort() for the appropriate canvas, and set up other
  218. //    attributes of the drawing environment. A FocusLib library
  219. //    is supplied to help focus drawing commands to a facet.
  220. //    Make sure to clip to the facet’s clipShape (FocusLib
  221. //    does this for you).
  222. // 4) Draw the part’s contents.
  223. // 5) Restore the old graphics environment.
  224. //
  225. // Part editors may sometimes need to display their parts
  226. // asynchronously, that is, not in response to a ::Draw() call.
  227. // This process is very similar to the basic drawing recipe,
  228. // with minor modifications.
  229. // 1) Determine which of the part’s frames should be drawn. A part
  230. //    may have multiple display frames, and more than one may need
  231. //    updating. Parts store their display frames in whatever way
  232. //    they want, so we can’t tell you how to find them here.
  233. // 2) For each frame being displayed, all facets must be drawn.
  234. //    ODFrame::CreateFrameFacetIterator() returns an iterator
  235. //    which will list all the facets of a frame. Draw the part’s
  236. //    contents in each of these facets, using the recipe above.
  237. // 3) After drawing in a facet, call ODFacet::DrawnIn() on it to
  238. //    tell it you’ve drawn in it asynchronously. If the facet is
  239. //    on an offscreen canvas, this lets it get copied into the window.
  240.  
  241. //----------------------------------------------------------------------------------------
  242.  
  243. void Explain_CanvasUpdated() {}
  244.  
  245. // Notifies the part that a canvas that it owns has been
  246. // updated and that its contents need to be copied to its
  247. // parent canvas.
  248. //
  249. // Called by the facet object.
  250. //
  251. // The data must be copied from an off-screen canvas,
  252. // transformed, and then placed in the containing canvas.
  253.  
  254. //----------------------------------------------------------------------------------------
  255.  
  256. void Explain_HighlightChanged() {}
  257.  
  258. // Notifies the part that the highlight state of one of its
  259. // frames has been changed.
  260. //
  261. // Called by the frame object.
  262. //
  263. // It adjusts this part's presentation in the facet to its
  264. // new highlight state. New state may be found by calling
  265. // facet->GetHighlight(). It passes notification to embedded
  266. // parts.
  267.  
  268. //----------------------------------------------------------------------------------------
  269.  
  270. void Explain_GetPrintResolution() {}
  271.  
  272. // Returns the minimum desired resolution in dots per inch
  273. // that this part requires for printing the contents of the
  274. // specified frame.
  275. //
  276. // Called by part or the application and is used in performing
  277. // printing.
  278.  
  279. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  280. // DRAG AND DROP
  281. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  282.  
  283. void Explain_DragLeave() {}
  284.  
  285. // Signals that the drag operation is complete, and so
  286. // deactivates the part from drag tracking.
  287. //
  288. // This method un-highlights any content previously highlighted
  289. // during drag tracking. It also removes the drag target border.
  290. // Before calling this method you must ensure that the part was
  291. // previously activated via DragEnter().  After executing this
  292. // method successfully, the part is no longer active, and cannot
  293. // receive further DragWithin() or Drop() messages.
  294. //
  295. // DragLeave() is called when the mouse leaves a droppable frame.
  296. // This allows the part to clean up after a drag within it
  297. // (e.g., removing adornment on the frame, changing the cursor
  298. // back to its original form).
  299.  
  300. //----------------------------------------------------------------------------------------
  301.  
  302. void Explain_Drop() {}
  303.  
  304. // Transfers the dragged data into this part.
  305. //
  306. // Called by the facet object.
  307. //
  308. // Respond to the Drop operation. This might involve moving or
  309. // copying data in to the part, or some other response entirely.
  310. // However, the response should use the data returned from the
  311. // dropInfo iterator to perform the operation. Before calling
  312. // this method, you must ensure that the part was previously
  313. // activated via DragEnter().
  314. //
  315. // Don't forget whether the drop is a move or a copy.
  316. //
  317. // Drop() is called when the mouse is released within a part which
  318. // owns the facet. The part can then figure out whether it can
  319. // receive the dragged object using the ODDragItemIterator passed
  320. // in. The following is a sample code fragment for incorporating
  321. // text into a part.
  322. //
  323. // The destination part should return an appropriate ODDropResult
  324. // from Drop(). This result tells the source part (via the system)
  325. // whether the drop is accepted.
  326.  
  327. //----------------------------------------------------------------------------------------
  328.  
  329. void Explain_DragWithin() {}
  330.  
  331. // Tracks the drag operation, and provides graphical feedback
  332. // regarding possible drop targets.
  333. //
  334. // This method highlights the appropriate content to provide
  335. // feedback about potential drop targets, based on type of dragged
  336. // data. It gets the type information out of the dragInfo. During
  337. // drag tracking (DragEnter, DragWithin) the part should never
  338. // attempt to read data from any of the storage units supplied by
  339. // the iterator. The part should only inspect the type of the
  340. // dragged data. Before calling tis method, you must ensure that
  341. // the part was previously activated via DragEnter().
  342. //
  343. // DragWithin() is called continuously when the mouse is still in
  344. // the facet. This allows the part to do any processing desired.
  345. // One good example is when the frame has several hot spots where
  346. // objects can be dropped. If the mouse is not over these hot spots,
  347. // the cursor may need to be changed to reflect that the no
  348. // dropping can be done there even though it is still in a
  349. // droppable frame. Again, a ODDragItemIterator is passed in so
  350. // that the part can examine the availabe data types of the dragged
  351. // objects.
  352. //
  353. // DragWithin() also provides a chance for the part to examine the
  354. // state of the machine. For example, some part may want to find
  355. // out whether the modifier keys are down or not.
  356.  
  357. //----------------------------------------------------------------------------------------
  358.  
  359. void Explain_DragEnter() {}
  360.  
  361. // Activates the part used to track the drag.
  362. //
  363. // Called by the facet object.
  364. //
  365. // The part should display a drag target border within the facet.
  366. // During drag tracking (DragEnter, DragWithin) the part should
  367. // never attempt to read data from any of the storage units supplied
  368. // by the iterator. The part should only inspect the type of the
  369. // dragged data. Before calling this method, you must ensure that
  370. // the part is ready to receive DrawWithin messages.
  371. //
  372. // DragEnter() is called when the mouse enters a facet.  The part
  373. // should examine the available data types of the dragged items
  374. // using the ODDragItemIterator passed in.  If the part can handle
  375. // a drop of the dragged object, it should provide the appropriate
  376. // feedback (e.g., adorning the droppable frame, changing the cursor).
  377. // If the destination part cannot handle the data types, nothing
  378. // should be done.
  379.  
  380. //----------------------------------------------------------------------------------------
  381.  
  382. void Explain_DropCompleted() {}
  383.  
  384. // Notifies the part that the drop is completed.
  385. //
  386. // Called by the dragAndDrop object.
  387. //
  388. // DropCompleted is a peculiar method. If DragAndDrop::StartDrag is
  389. // synchronous, the return code to DragAndDrop::StartDrag is the
  390. // drop result. Part::DropCompleted does not need to be called.
  391. // However, if it is required that DragAndDrop::StartDrag returns
  392. // immediately, there needs to be a way to notify the result of the
  393. // drop. Before calling this method, you must ensure that the part
  394. // previously started an asynchronous drag.
  395.  
  396. //----------------------------------------------------------------------------------------
  397.  
  398. void Explain_FulfillPromise() {}
  399.  
  400. // Fulfills a previously made promise by providing the actual
  401. // data the promise represents.
  402. //
  403. // The promiseSUView is a view into the same storage unit value
  404. // that is created by SetPromiseValue. The information about the
  405. // promise is encoded in the promiseSUView in the Part Handler's
  406. // own internal format. The promise data is written into the
  407. // promiseSUView replacing the data stored in the part handler's
  408. // format.
  409. //
  410. // When the promise was made, a record of it was kept by this part.
  411. // The promiseSUView contains the part's information for that promise.
  412. // The part uses the data in the promiseSUView to determine which
  413. // data to move/copy. The part then writes the data into the
  414. // promiseSUView.
  415. //
  416. // The format of a promise is determined by the part. The only
  417. // restriction is that a promise must be able to be written to
  418. // a Storage Unit Value.
  419. //
  420. // The destination part does not even know that the fulfilment
  421. // of a promise is taking place.
  422.  
  423. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  424. // EMBEDDING
  425. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  426.  
  427. void Explain_ContainingPartPropertiesChanged() {}
  428.  
  429. // Used by ContainingPart to inform the contained part of
  430. // changes to the content properties of that object within
  431. // the containing part’s content model that encapsulates the
  432. // embedded frame.
  433. //
  434. // This method inspects “propertyUnit” for properties that this
  435. // part can understand. Where applicable, it incorporate those
  436. // properties into part's content data. It ignores inapplicable
  437. // properties, without signalling an error.
  438.  
  439. //----------------------------------------------------------------------------------------
  440.  
  441. void Explain_GetContainingPartProperties() {}
  442.  
  443. // Used by an embedded part to create a storage unit and write
  444. // properties that the containing part associates with the
  445. // embedded frame into it, before returning it.
  446. //
  447. // Called by an embedded part.
  448.  
  449. //----------------------------------------------------------------------------------------
  450.  
  451. void Explain_RevealFrame() {}
  452.  
  453. // Asks a part to make an embedded frame visible.
  454. //
  455. // Called by an embedded part.
  456. //
  457. // This method scrolls one of this part's display frame's to make
  458. // the embedded frame visible therein. If this part has no visible
  459. // frames, it asks a containing part to reveal one of them. If no
  460. // display frames for the part currently exist, or if this part's
  461. // containing frame can't reveal the display frame, it opens a frame
  462. // in a new window.
  463.  
  464. //----------------------------------------------------------------------------------------
  465.  
  466. void Explain_EmbeddedFrameSpec() {}
  467.  
  468. // Creates an object specifier for the embedded frame.
  469. //
  470. // If this part is itself embedded, this method asks its containing
  471. // part for the specifier for the part's display frame, then
  472. // concatenates the specifier for that embedded frame.
  473.  
  474. //----------------------------------------------------------------------------------------
  475.  
  476. void Explain_CreateEmbeddedFramesIterator() {}
  477.  
  478. // Creates an object that will iterate over the frames that
  479. // are embedded within a display frame of this part.
  480. //
  481. // To indicate all the display frames, use kODNull for the frame
  482. // parameter.
  483.  
  484. //----------------------------------------------------------------------------------------
  485.  
  486. void Explain_EmbeddedFrameChanged() {}
  487.  
  488. // Notifies the containing part that the content displayed
  489. // in the argument “embedded frame” has changed.
  490. //
  491. // Called by an frame object belonging to an embedded part when
  492. // the frame object's ContentChanged method is called.
  493. //
  494. // The part should call the ContentChanged method of any of its
  495. // frames that would be interested in this information. This
  496. // method should only be called by frame objects. The part is
  497. // not responsible for passing this notification on to its
  498. // containing part. The part may ignore this notification if it
  499. // is uninterested in changes to embedded content. A part should
  500. // wait a certain length of time (a second perhaps) before
  501. // updating its display so that subsequent calls to
  502. // EmbeddedFrameChanged with the same ODChangeID don’t result
  503. // in multiple updates for the same change.After executing this
  504. // method successfully, the ContentChanged method of any of the
  505. // part's frames may have been called and the part may have
  506. // taken action to update its display.
  507.  
  508. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  509. // EVENTS
  510. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  511.  
  512. void Explain_HandleEvent() {}
  513.  
  514. // Below is some documentation for this method.  If you don't care for
  515. // being here, then just delete it.
  516. //
  517. // The frame and facet parameters of HandleEvent() may be
  518. // kODNULL, depending on the kind of event.
  519. //
  520. // Parts must handle the following events, which correspond to
  521. // standard Macintosh events:
  522. //
  523. //    kODEvtNull
  524. //     kODEvtMouseDown
  525. //     kODEvtMouseUp
  526. //     kODEvtKeyDown
  527. //     kODEvtKeyUp
  528. //     kODEvtAutoKey
  529. //     kODEvtUpdate
  530. //     kODEvtActivate
  531. //     kODEvtOS
  532. //
  533. // Null Events --
  534. // In order to receive null events (i.e. idle time), parts must call
  535. // ODDispatcher::RegisterIdle(), specifying the part, a frame
  536. // (optional) and idle frequency. The part will receive a null event
  537. // for each frame registered. ODDispatcher::GetSleepTime() is called
  538. // by the shell, and the value passed to WaitNextEvent. An appropriate
  539. // sleep time is computed based on the idle frequencies of registered
  540. // idle frames.
  541. //
  542. // Mouse Events --
  543. // Unmodified mouse events are delivered to the facet under the mouse
  544. // location using Part::HandleEvent().
  545. //
  546. // Shift-Click and Command-Click go to the frame with the selection
  547. // focus.  Mouse events in window title bars are converted to window
  548. // events. (See below)  Mouse down events in the menu bar are converted
  549. // to menu events. (See below)
  550. //
  551. // Keyboard Events --
  552. // Keyboard events go to the frame with the keyboard focus, with the
  553. // exception of the Page Up, Page Down, Home and End keys, which will
  554. // go to the frame with the scrolling focus, if there is one.
  555. //
  556. // Update Events --
  557. // Update events are not passed to Part::HandleEvent(). Rather
  558. // Part::Draw() will be called for each facet in the window.
  559. //
  560. // Activate Events --
  561. // Activate events are also delivered to each facet, using
  562. // Part::HandleEvent().
  563. //
  564. // Disk Events --
  565. // Currently, disk events are not distributed to parts.
  566. // But where do they go???
  567. //
  568. // OS Events --
  569. // Suspend/Resume events are delivered to each facet in each
  570. // window using Part::HandleEvent().
  571. //
  572. // Mouse Moved events are not passed to Part::HandleEvent().
  573. // They are handled by the dispatcher, and translated into calls
  574. // to Part::MouseEnter(), MouseWithin() and MouseLeave().
  575. // See Cursor Tracking below.
  576. //
  577. // Menu Events --
  578. // OpenDoc converts a mouse down in the menu bar, or its
  579. // command-key equivalent, into a menu event of type kODEvtMenu.
  580. //
  581. // The message field of the event record contains the result
  582. // returned by MenuSelect() or MenuKey(). i.e. the menu is in
  583. // the high word, and the item in the low word. The part can
  584. // obtain a command number using ODMenuBar::GetCommand().
  585. //
  586. // Window Events --
  587. // Events in the title bar of a window (eg. clicking in the
  588. // close box) are usually handled by the shell, but are first
  589. // offered to the root part of the window. Parts which wish to
  590. // intercept these events (perhaps to hide rather than close a
  591. // window) must handle the following event: kODEvtWindow
  592. // The message field of the event contains the part code, as
  593. // returned by FindWindow().
  594. //
  595. // Events in Embedded Frames --
  596. // Parts which support embedding may also receive the following events:
  597. //
  598. //    kODEvtMouseDownEmbedded
  599. //    kODEvtMouseUpEmbedded
  600. //    kODEvtMouseDownBorder
  601. //    kODEvtMouseUpBorder
  602. //
  603. // If the user clicks in the active border, the containing
  604. // facet/frame/part will receive a kODEvtMouseDownBorder event.
  605. // The message field of the event record contains the embedded facet.
  606. //
  607. // Similarly, if the user clicks in an embedded frame with the
  608. // “frozen” or “selected” property set, a kODEvtMouseDownEmbedded
  609. // event is directed to the containing frame.
  610. //
  611. // If the user shift-clicks or command-clicks in a frame which is
  612. // embedded in the frame with the selection focus, then the latter
  613. // frame gets a kODEvtMouseDownEmbedded event.
  614. //
  615. // Cursor Tracking --
  616. // OpenDoc tracks cursor movement (with the mouse button up), and
  617. // calls MouseEnter() when the cursor first moves into a facet, and
  618. // MouseLeave() when the cursor leaves the facet. A part can change
  619. // the cursor on MouseEnter, and set it to the arrow on MouseLeave.
  620. //
  621. // This process is triggered by the shell calling
  622. // ODDispatcher::GetMouseRegion() and passing the result to
  623. // WaitNextEvent(). The region is only recomputed when necessary.
  624. // If the cursor is motionless within a facet, the shell application
  625. // goes to sleep because OpenDoc computes a mouse region containing
  626. // just the cursor location. The part can make this region larger
  627. // by calling ODDispatcher::SetMouseRegion(). In a future release,
  628. // OpenDoc will also compute a suitably large sleep region if the
  629. // cursor is not within any facet.
  630. //
  631. // Modal Focus --
  632. // Some events are constrained by the modal focus. For example a
  633. // mouse click outside the frame with the modal focus will be sent
  634. // to the modal focus frame, but a click in an embedded frame
  635. // within the modal focus frame will go to the embedded frame.
  636. //
  637. // Propagating Events --
  638. // If a containing part sets the “DoesPropagateEvents” property of
  639. // an embedded frame, the containing part will receive events not
  640. // handled by the embedded frame. A part which does this will have
  641. // to inspect the frame passed to HandleEvent() to determine if it
  642. // is one of its display frames.
  643.  
  644. //----------------------------------------------------------------------------------------
  645.  
  646. void Explain_AdjustMenus() {}
  647.  
  648. // WRITE YOUR OWN
  649.  
  650. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  651. // FOCUSING
  652. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  653.  
  654. void Explain_BeginRelinquishFocus() {}
  655.  
  656. //----------------------------------------------------------------------------------------
  657.  
  658. void Explain_CommitRelinquishFocus() {}
  659.  
  660. // No choices to be made here.  It's too late to say no.  We are
  661. // losing the focus if we are here.  Getting called here means
  662. // that BeginRelinquishFocus has already agreed that losing focus
  663. // is okay.  If you don't want this to be happening, then you need
  664. // to do something in BeginRelinquishFocus.
  665. //
  666. // The way that some other samples are currently written I believe
  667. // to be in error.  The recipes say that when this is called, it
  668. // has already been decided that, focus-wise, you lose.  Therefore
  669. // there should be no conditions on calling FocusLost.
  670.  
  671. //----------------------------------------------------------------------------------------
  672.  
  673. void Explain_AbortRelinquishFocus() {}
  674.  
  675. // Being here means that BeginRelinquishFocus said no to one of the foci.
  676. // You are being informed of this because you may have already taken action
  677. // based on a previous focus.  Note that if foci are managed as a set, if
  678. // BeginRelinquishFocus says false to any of the foci, then no action is
  679. // taken.  If however the foci are tested one at a time, it is possible that
  680. // the part has already taken action based on the first foci, and therefore
  681. // needs to undo something once a foci says no thanks.
  682.  
  683. //----------------------------------------------------------------------------------------
  684.  
  685. void Explain_FocusAcquired() {}
  686.  
  687. // WRITE YOUR OWN
  688.  
  689. //----------------------------------------------------------------------------------------
  690.  
  691. void Explain_FocusLost() {}
  692.  
  693. // WRITE YOUR OWN
  694.  
  695. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  696. // FRAME
  697. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  698.  
  699. void Explain_DisplayFrameAdded() {}
  700.  
  701. // Tells a part to add “frame” as one of its display frames.
  702. //
  703. // This method is only called by frame objects during their
  704. // initialization.  Same for RemoveDisplayFrame() and
  705. // CloseDisplayFrame().
  706. //
  707. // The part must record “frame” in whatever internal structures it
  708. // uses to remember its display frames. The new frame will carry a
  709. // suggested viewType and presentation information. The part should
  710. // look at those settings, and decide if it can support them; if not,
  711. // it should update those settings in the frame to reflect a default
  712. // presentation that it can support. Note that the part must support
  713. // the required set of standard viewTypes (frame, icon, small icon,
  714. // thumbnail, etc.). The part will then create the appropriate
  715. // partInfo data and store it in the frame. This data allows the part
  716. // to distinguish the frame from its other display frames, and is
  717. // also a handy place to store other view-related information.
  718. //
  719. // Add the new display frame to the part’s list of its display frames.
  720. // This list, like the part’s other internal structures, is completely
  721. // hidden from OpenDoc. The developer may represent this list any way
  722. // he chooses. The simplest of parts may be able to do without such a
  723. // list, but most parts will require it.
  724. //
  725. // Validate the viewType and presentation of the new frame. The part
  726. // must support the required set of view types. Other kinds of view
  727. // types or presentations are optional. The part should inspect these
  728. // values and correct them if necessary. See the recipe for View Types
  729. // and Presentations for more detail.
  730. //
  731. // Add partInfo to the frame. The partInfo field of a frame is a
  732. // convenient place for a part to store information about that view of
  733. // itself. It can be anything from a simple ID to a pointer to a
  734. // complicated structure or a helper object. The partInfo for a frame
  735. // is stored in the storage unit for the frame, not the part. If the
  736. // part has many frames of which only a few are internalized, only the
  737. // partInfo of those frames will be internalized and take up memory.
  738. //
  739. // The display frames need not be internalized until needed and will be
  740. // done by the containing part. ???
  741.  
  742. //----------------------------------------------------------------------------------------
  743.  
  744. void Explain_DisplayFrameConnected() {}
  745.  
  746. //----------------------------------------------------------------------------------------
  747.  
  748. void Explain_DisplayFrameRemoved() {}
  749.  
  750. // Will remove the frame from the list of display frames.
  751. //
  752. // Called by Frame::Remove().
  753. //
  754. // This method makes whatever other adjustments are necessary
  755. // to deal with removing one of the presentations. This includes
  756. // removing any frames embedded within this display frame.
  757. // Before calling this method, you must ensure that the frame
  758. // has no facets.
  759.  
  760. //----------------------------------------------------------------------------------------
  761.  
  762. void Explain_DisplayFrameClosed() {}
  763.  
  764.  
  765. // Informs a part that one of its display frames is closing.
  766. //
  767. // Called by the frame object.
  768. // The part should remove “frame” from its list of display frames,
  769. // call Frame::Close() on any frames that are embedded within that
  770. // frame, and then release the frame.
  771.  
  772. //----------------------------------------------------------------------------------------
  773.  
  774. void Explain_FrameShapeChanged() {}
  775.  
  776.  
  777. // Notifies the part that the frame shape of one of its
  778. // display frames has been changed by its containing part.
  779. //
  780. // Called by Frame::ChangeFrameShape.
  781. //
  782. // The part should take whatever actions are necessary to respond
  783. // to the new shape. It may need to re-layout its content, change
  784. // its used shape, resize its embedded frames, or something else.
  785. // It also has the option of turning around and asking the frame
  786. // for a different frame shape via RequestFrameShape, though it
  787. // must be able to handle the shape it is given. If the size of
  788. // the frame is not sufficient, the part may ask the containing
  789. // part for a continuation frame via CreateEmbeddedFrame.
  790.  
  791. //----------------------------------------------------------------------------------------
  792.  
  793. void Explain_AttachSourceFrame() {}
  794.  
  795. // Called by the object that requested creation of a frame,
  796. // immediately after the creation of the frame.
  797. //
  798. // Calling this method associates a “source frame” with a display
  799. // frame of a part. This tells the part to keep two or more of its
  800. // display frames synchronized.
  801. //
  802. // A part will receive this call just after a display frame has
  803. // been added. Attaching a source frame should cause the display
  804. // frame to look identical to it. If presentations differ, it
  805. // causes the display frame to be equivalent to it. This causes
  806. // duplication of the embedded frames, and ensures that the view
  807. // in one frame is updated when content in the other is changed.
  808. // Before calling this method, you must ensure that both frame
  809. // and sourceFrame are display frames of the part.
  810. //
  811. // The part being displayed should take whatever action necessary
  812. // to synchronize the frames. As a minimum, if the two frames are
  813. // the same kind of presentation, it should duplicate embedded
  814. // frames in one frame into the other.
  815.  
  816. //----------------------------------------------------------------------------------------
  817.  
  818. void Explain_ViewTypeChanged() {}
  819.  
  820. // Notifies the part that the viewType of one of its
  821. // frames has been changed.
  822. //
  823. // Parts must support all standard view types.
  824. // And they are ... ???
  825.  
  826. //----------------------------------------------------------------------------------------
  827.  
  828. void Explain_PresentationChanged() {}
  829.  
  830. // Notifies the part that the presentation kind of one
  831. // of its frames has been changed.
  832. //
  833. // Called by Frame::ChangeViewType().
  834. //
  835. // The part should examine the new view type via
  836. // frame->GetViewType(). If the part does not support that kind
  837. // of view type, it should correct the frame's viewType using
  838. // frame->SetViewType(). Note that parts MUST support the
  839. // standard set of view types (se HI spec). The part should then
  840. // adjust its display in the display frame to be of the new view
  841. // type.
  842.  
  843. //----------------------------------------------------------------------------------------
  844.  
  845. void Explain_SequenceChanged() {}
  846.  
  847. // Informs the part that the sequencing of a group of its
  848. // display frames has been changed.
  849. //
  850. // Called by containing part.
  851. //
  852. // The containing part of frame should call this when adding a new
  853. // frame to the group or re-ordering the frames in the group. A
  854. // single frame of the group is passed as an argument to indicate
  855. // which group of which containing frame has been changed.
  856.  
  857. //----------------------------------------------------------------------------------------
  858.  
  859. void Explain_WritePartInfo() {}
  860.  
  861. // Externalizes the frame's partInfo data onto the frame's
  862. // storage unit.
  863. //
  864. // Called by the frame object.
  865. //
  866. // Duh???
  867.  
  868. //----------------------------------------------------------------------------------------
  869.  
  870. void Explain_ReadPartInfo() {}
  871.  
  872. // Internalizes the partInfo for a display frame of this part.
  873. //
  874. //
  875. // Called by the frame object.
  876. //
  877. // The data for the partInfo is stored in a value in the frame's
  878. // storage unit, specified by the suView parameter. It gets the
  879. // data from out of the value, and places it in a block of memory.
  880. // It then returns the memory block to the frame for it to hold.
  881.  
  882. //----------------------------------------------------------------------------------------
  883.  
  884. void Explain_RequestEmbeddedFrame() {}
  885.  
  886. // Asks the part to create a new frame and embed a part in it.
  887. //
  888. // This is only requested by embedded parts which want additional
  889. // frames in which to display in the same containing part.
  890. //
  891. // If this part is a containing part, it should ask the draft to
  892. // create a new frame, and embed the frame in its content.
  893. // “baseFrame” is another display frame of the same part, already
  894. // embedded in the same containing part. The frameShape parameter
  895. // is relative to the frame coordinate system of the baseFrame.
  896. // The containing part decides if it can fulfill the requests for
  897. // frameShape. - if not, it can create the frame where it wants
  898. // and with the shape it chooses. The containing part should assign
  899. // the new frame to the same frameGroup as the baseFrame. If
  900. // isOverlaid is true, the new frame should float above the part's
  901. // content, and should not have to negotiate for space with the part.
  902. // The viewType and presentation are just passed through to
  903. // Draft::CreateFrame().
  904. //
  905. // Note that RequestEmbeddedFrame should only be called by an embedded
  906. // part on its containing part in order to get a sibling frame.  That
  907. // is why this call takes a baseFrame parameter.  The baseFrame must
  908. // already be embedded inside the part receiving the
  909. // RequestEmbeddedFrame message.
  910.  
  911. //----------------------------------------------------------------------------------------
  912.  
  913. void Explain_RemoveEmbeddedFrame() {}
  914.  
  915. // Removes a frame used for viewing an embedded part.
  916. //
  917. // Called by an embedded part.
  918. //
  919. // It is called by an embedded part to indicate it no longer
  920. // needs the frame to display itself.
  921.  
  922. //----------------------------------------------------------------------------------------
  923.  
  924. void Explain_RequestFrameShape() {}
  925.  
  926. // Used by an embedded part to ask for a change in the
  927. // shape of its frame.
  928. //
  929. // Called by Frame::RequestFrameShape().
  930. //
  931. // This method decides what new shape to give the embedded frame,
  932. // using the requested “frameShape” as a guideline. It then
  933. // answers with what shape is actually granted as the return value.
  934. // The requestor must abide by the returned shape, though it may
  935. // make further requests for different shapes or additional frames.
  936.  
  937. //----------------------------------------------------------------------------------------
  938.  
  939. void Explain_UsedShapeChanged() {}
  940.  
  941. // Informs a containing part that the used shape of one of
  942. // its embedded frames has changed.
  943. //
  944. // Called by Frame::ChangeUsedShape().
  945. //
  946. // Containing parts that have arranged their content to conform
  947. // to the used shape of an embedded frame (as in text wrapping)
  948. // will need to adjust the layout of that content for the new
  949. // used shape.
  950.  
  951. //----------------------------------------------------------------------------------------
  952.  
  953. void Explain_AdjustBorderShape() {}
  954.  
  955. // Adjusts the shape of the active frame border of an embedded
  956. // frame.
  957. //
  958. // Called by the arbitrator object.
  959. //
  960. // The “shape” parameter specifies the requested shape. The
  961. // return value specifies that shape as it is obscured by the
  962. // other contents of this part.
  963.  
  964. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  965.  
  966. void Explain_FacetAdded() {}
  967.  
  968. //----------------------------------------------------------------------------------------
  969.  
  970. void Explain_FacetRemoved() {}
  971.  
  972. //----------------------------------------------------------------------------------------
  973.  
  974. void Explain_CanvasChanged() {}
  975.  
  976. // Notifies the part that one of its facets has been moved to
  977. // image on a different canvas.
  978. //
  979. // Called by the facet object.
  980. //
  981. // The part must update any internal state necessary for
  982. // compliance with this method.
  983.  
  984. //----------------------------------------------------------------------------------------
  985.  
  986. void Explain_GeometryChanged() {}
  987.  
  988. // Called by a facet of the part to inform it that the clipping
  989. // shape and/or external transform of that facet has changed.
  990. //
  991. // Called by the facet object.
  992. //
  993. // The part should use the new clip shape for display from now
  994. // on. Parts that display only in response to update events don't
  995. // need to do anything special, provided they check the clip
  996. // shape each time they draw. Parts that display asynchronously
  997. // (like clocks, movies, etc.) must notice their new clipping and
  998. // limit their display accordingly.
  999.  
  1000. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  1001. // LINKING
  1002. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  1003.  
  1004. void Explain_CreateLink() {}
  1005.  
  1006. // Creates a new link object.
  1007. //
  1008. // If a link already exists to the content identified by the data
  1009. // and size arguments, this method returns the link object;
  1010. // otherwise, it creates a new link object, puts in the initial
  1011. // data and returns it to the caller.
  1012. //
  1013. // This method identifies the content to be linked (by resolving
  1014. // the object specifier saved in the data parameter, or by some
  1015. // other means). It then creates a link object to represent the
  1016. // content data. The part must maintain information about what
  1017. // portion of its contents have been linked to it, so that it may
  1018. // notify link clients when that data has been changed. The link
  1019. // created is returned to the caller. Before calling this method,
  1020. // you must ensure that the data identifies some portion of this
  1021. // part's contents. After calling this method successfully, this
  1022. // part maintains a link to the identified content.
  1023.  
  1024. //----------------------------------------------------------------------------------------
  1025.  
  1026. void Explain_LinkUpdated() {}
  1027.  
  1028. // Retrieves the data from the link and incorporates it into
  1029. // this part at the link's destination, thereby replacing any
  1030. // previous content of the link.
  1031.  
  1032. //----------------------------------------------------------------------------------------
  1033.  
  1034. void Explain_RevealLink() {}
  1035.  
  1036.  
  1037. // Reveals data that was previously linked in a window, making it
  1038. // available for viewing in a display frame.
  1039. //
  1040. // Called by ODLinkSource objects.  Should not be called by parts.
  1041. // In some display frame for this part, this method selects the
  1042. // content linked by the linkSource argument, and scrolls it into
  1043. // view. That display frame is made the active frame. If no display
  1044. // frames for the part currently exist, or if this part's containing
  1045. // frame can't reveal the display frame, it opens a frame in a new
  1046. // window.
  1047.  
  1048. //----------------------------------------------------------------------------------------
  1049.  
  1050. void Explain_LinkStatusChanged() {}
  1051.  
  1052. // Allows the part to set the link status of any embedded frames.
  1053. //
  1054. // Called by a part's frame when that frame's ChangeLinkStatus
  1055. // method is called.
  1056. //
  1057. // Frames notify their owner parts that their link status has
  1058. // changed whenever ChangeLinkStatus is called. After this
  1059. // method executes successfully, the part will call
  1060. // ChangeLinkStatus on any embedded frames that are involved
  1061. // in the link in question.
  1062.  
  1063. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  1064. // UNDO
  1065. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  1066.  
  1067. void Explain_UndoAction() {}
  1068.  
  1069. // Tells the part to undo the action that is described by actionState.
  1070. //
  1071. // Called by the undo object.
  1072.  
  1073. //----------------------------------------------------------------------------------------
  1074.  
  1075. void Explain_RedoAction() {}
  1076.  
  1077. // Tells the part to Redo the action described by actionState.
  1078. //
  1079. // Called by the undo object.
  1080.  
  1081. //----------------------------------------------------------------------------------------
  1082.  
  1083. void Explain_DisposeActionState() {}
  1084.  
  1085. // Tells the part to dispose of the action data.
  1086. //
  1087. // Before calling this method, you must ensure that “actionState”
  1088. // is an action data block previously logged by this part. After
  1089. // calling this method successfully, memory for “actionState” has
  1090. // been reclaimed. It is no longer usable to perform undo operations.
  1091.  
  1092. //----------------------------------------------------------------------------------------
  1093.  
  1094. void Explain_WriteActionState() {}
  1095.  
  1096. // Writes out the actionState data onto a StorageUnitView,
  1097. // and externalizes the undoAction data to the storage unit.
  1098. //
  1099. // Called by the undo object.
  1100.  
  1101. //----------------------------------------------------------------------------------------
  1102.  
  1103. void Explain_ReadActionState() {}
  1104.  
  1105. // Internalizes the undoAction data from the storage unit.
  1106. //
  1107. // This method reads the actionState data from a view on a
  1108. // StorageUnit. It then allocates the memory and passes ownership
  1109. // of the storage to the caller.
  1110.  
  1111. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  1112. // BINDING
  1113. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  1114.  
  1115. void Explain_ExternalizeKinds() {}
  1116.  
  1117. // Externalizes a representation for each 'kind' that it supports.
  1118. //
  1119. // The part should iterate through all the kinds in 'kindList',
  1120. // and externalize a representation for each that it supports.
  1121. // This call does not specify anything about the ordering of those
  1122. // kinds in the contents property. Before calling this method,
  1123. // you must ensure that the part supports a subset of the kinds
  1124. // in 'kindList'. After executing this method successfully, the
  1125. // contents property of the part has a value and representation
  1126. // for each kind in kindListsupported.
  1127.  
  1128. //----------------------------------------------------------------------------------------
  1129.  
  1130. void Explain_ChangeKind() {}
  1131.  
  1132. // Asks a part to change into a new kind of content,
  1133. // i.e. ask an ASCII Text part to change into a Styled Text part.
  1134. //
  1135. // The part should begin using the given kind as its primary kind
  1136. // if it is supported. The first type of the first value in the
  1137. // content property of the part's storage unit should become the
  1138. // given kind. Before calling this method, you must ensure that the
  1139. // part supports the specified kind. After this method is executed
  1140. // successfully, the part's primary kind is the one that was
  1141. // specified in the parameter, and the first type of the first
  1142. // value in the content property of the part's storage unit is of
  1143. // the specified type. When it reads in data, the part uses this
  1144. // representation.
  1145.  
  1146. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  1147.  
  1148.